import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.randn(10, 4))
print(df)

# concat
print("concat")
pieces = [df[:3], df[3:7], df[7:]]
print(pieces)

df_concat = pd.concat(pieces)

print(df_concat)

# join
left = pd.DataFrame({'key': ['foo', 'foo'], 'lval': [1, 2]})
right = pd.DataFrame({'key': ['foo', 'foo'], 'rval': [4, 5]})
pd_merge = pd.merge(left, right, on='key')
print(left)
print(right)
print(pd_merge)

# append
print("Append")
df = pd.DataFrame(np.random.randn(8, 4), columns=['A','B','C','D'])
s = df.iloc[3]
df_append = df.append(s, ignore_index=True)
print(df, "\n result=\n", df_append)
